# Maintainer: Martell Malone <martellmalone@gmail.com>

_realname=libelf
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.8.13
pkgrel=4
pkgdesc="ELF object file access library (mingw-w64)"
arch=('any')
license=('LGPL')
url="http://www.mr511.de/software/english.html"
options=('staticlibs')
source=("http://www.mr511.de/software/${_realname}-${pkgver}.tar.gz")
sha256sums=('591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d')

build() {
  [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH} 
  mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH} 
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --enable-extended-format=yes

  make -j1 all
}

package() {
  cd "${srcdir}"/build-${CARCH}
  make install instroot="${pkgdir}"
}
